<?php include dirname(__FILE__).'/common/header.php'; ?>

<?php include dirname(__FILE__).'/common/menu.php'; ?>

var attr = {};
attr.ctrlName = '<?php echo $ctrlName; ?>';
attr.game_gift = <?php echo $game_gift ?>;

/*
| -------------------------------------------------------------------
|  List Grid
| -------------------------------------------------------------------
*/
list.grid = new ZM.GridPanel({
    url: list.baseUrl + attr.ctrlName+'/getCustomerList',
    tbar:[{
        text:'导出过滤顾客',
        cls:'btn-show',
        hidden:!Ext.permission[attr.ctrlName + '/exportCustomerList'.toLowerCase()],
        handler:function() {
            var sortInfo = list.grid.store.getSortState();
            if(sortInfo) {
                list.grid.store.baseParams['sort'] = sortInfo['field'];
                list.grid.store.baseParams['dir'] = sortInfo['direction'];
            }
            location.href = list.baseUrl + attr.ctrlName + '/exportCustomerList?'+ Ext.urlEncode(list.grid.store.baseParams);
        }
    }],
    columns:[
        {header:'ID',dataIndex:'customer_id',filter:{}},
/*        
        {header:'礼品',dataIndex:'gift_type',sort:true,filter:{xtype:'combofield',options:[['','全部']].concat(attr.game_gift)}
            ,renderer:function(val) {
            return ZM.id2name(val,attr.game_gift);
        }},
*/
        {header:'姓名',dataIndex:'customer_name',filter:{}},
        {header:'手机号',dataIndex:'customer_phone',filter:{}},
        {header:'收货地址',dataIndex:'customer_address',width:200,filter:{}},
        {header:'微信号',dataIndex:'customer_weixin',filter:{}},
        {header:'护照主页信息照片',dataIndex:'customer_passport_picture_info_path',renderer:function(val) {
        	return ZM.cellImage(val);
        }},
        {header:'申请时间',dataIndex:'customer_time_create',filter:{xtype:'daterangefield'}}
    ]
});

<?php include dirname(__FILE__).'/common/layout.php'; ?>
list.grid.store.load();
<?php include dirname(__FILE__).'/common/footer.php'; ?>